<link rel="stylesheet" type="text/css" href='{{ assets["supported_versions.css"].digest_path | true_relative_url }}' />

{%- assign osVersions = site.data.supported_versions.bashible | sort %}
{%- assign k8sVersions = site.data.supported_versions.k8s  %}
{%- assign langSupportKey = page.lang | append: "_support" %}

## Linux

{{ site.data.i18n.common['os_supported_phrase'][page.lang] }}:

<div markdown="0">
<table class="supported_versions">
<thead>
    <tr>
      <th class="name">{{site.data.i18n.common['linux_distro'][page.lang] }}</th>
      <th class="versions">{{ site.data.i18n.common['versions_supported'][page.lang] | capitalize }}</th>
    </tr>
</thead>
<tbody>
{%- for osItem in osVersions %}
{%- assign osKey = osItem[0] %}
{%- assign osName = site.data.supported_versions.osDistributions[osKey].name | default: osKey  %}
{%- if site.data.supported_versions.osDistributions[osKey][langSupportKey] and site.data.supported_versions.osDistributions[osKey][langSupportKey] != "true" %}{% continue %}{% endif %}
<tr>
  <td class="name">
    <span {% if site.data.supported_versions.osDistributions[osKey]['ru_support'] == "true" %}class="table__asterisk"{% endif %}>
      {%- if site.data.supported_versions.osDistributions[osKey].url %}<a href="{{ site.data.supported_versions.osDistributions[osKey].url }}" target="_blank">{{ osName }}</a>
      {%- else %}{{ osName }}
      {%- endif%}
    </span></td>
  <td class="versions">
{%- for osData in osItem[1] %}
{%- assign osVersion = osData[0] %}
{{ osVersion }}{% if site.data.supported_versions.osDistributions[osKey]['versions'][osVersion] %} ({{ site.data.supported_versions.osDistributions[osKey]['versions'][osVersion]['name'] }}){% endif %}
{%- unless forloop.last %},{% endunless %}
{%- endfor %}
  </td>
</tr>
{%- endfor %}
</tbody>
</table>
{% if page.lang == 'ru' %}
<em style="margin-top: 16px; display: block;">* Поддержка предоставляется только в редакции EE. Работоспособность в редакции CE не гарантируется.</em>
{%  endif %}
</div>

## Kubernetes

{{ site.data.i18n.common['k8s_supported_phrase'][page.lang] }}:

<div markdown="0">
<table class="supported_versions__kubernetes">
<thead>
    <tr>
      <th style="width: 5%;"></th>
      <th style="text-align: center; width: 1%;">{{ site.data.i18n.common['version'][page.lang] | capitalize }}</th>
      <th>{{site.data.i18n.common['status'][page.lang] | capitalize }}</th>
    </tr>
</thead>
<tbody>
{%- for k8sItem in k8sVersions %}
{%- assign k8sStatus = k8sItem[1].status | default: 'preview' %}
{%- assign iconStatus = k8sStatus| append: '.svg' | prepend: '/images/icons/' %}
<tr {%- if k8sItem[0] == site.data.version_kubernetes.default %} class="highlight-default"{% endif %}>
  <td style="text-align: center">
    <img src="{{ iconStatus }}" alt="" />
  </td>
  <td style="text-align: center; font-weight:bold">{{ k8sItem[0] }}</td>
  <td style="text-align: left">
    <p>{%- if k8sItem[0] == site.data.version_kubernetes.default %}<strong>{{ site.data.i18n.common['default_version'][page.lang] | capitalize }}.</strong> {% endif %}
    {{ site.data.supported_versions.k8s_statuses[k8sStatus][page.lang] }}</p>
  </td>
</tr>
{%- endfor %}
</tbody>
</table>
</div>

## Container registry

{% alert level="info" %}
{%- if page.lang == 'ru' %}
Deckhouse должен работать с любыми container registry, поддерживающими работу с Bearer token-схемой авторизации и с [OCI форматом образов](https://github.com/opencontainers/image-spec/blob/main/spec.md).
{%- else %}
Deckhouse should work with any container registry supporting Bearer authentication and [OCI image format specification](https://github.com/opencontainers/image-spec/blob/main/spec.md).
{%- endif %}
{% endalert %}

<div markdown="0">
<table class="supported_versions__kubernetes">
<thead>
<tr><th>
{%- if page.lang == 'ru' %}
Container registry, с которыми Deckhouse гарантированно работает
{%- else %}
Сontainer registries that Deckhouse is guaranteed to work with
{%- endif %}
</th></tr>
</thead>
<tbody>
{%- for registry in site.data.supported_versions.registries %}
<tr>
  <td style="text-align: left"
  {%- if registry[1].additionalInfo %} table__hint_{{ registry[0] }}{% endif -%}>
  <p><a href="{{ registry[1].url }}" target="_blank">{{ registry[1].longname }}{% if registry[1].additionalInfo %}<sup>*</sup>{% endif %}</a></p>
  </td>
</tr>
{%- endfor %}
</tbody>
</table>
</div>

<script type="text/javascript">
$(document).ready(function () {
{%- for registry in site.data.supported_versions.registries %}
{%- if registry[1].additionalInfo %}
    tippy('[table__hint_{{ registry[0] }}]', {
        interactive: true,
        interactiveDebounce: 10,
        maxWidth: 600,
        theme: 'custom',
        allowHTML: true,
        arrow: false,
        content: `{{ registry[1].additionalInfo[page.lang] }}`
      });
{%- endif -%}
{%- endfor %}
});
</script>
